<!-- 지도 페이지(기능 미구현) -->
<!DOCTYPE html>
<html>
<head>
    <title>Tag Read</title>
    <meta charset="utf-8" name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.0-alpha.2/jquery.mobile-1.4.0-alpha.2.min.css">
<style type="text/css">
html, body{ height:100% }
</style>
    <script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.4.0-alpha.2/jquery.mobile-1.4.0-alpha.2.min.js"></script>
<script type="text/javascript"
	src="http://maps.googleapis.com/maps/api/js?sensor=true"></script>
<script type="text/javascript">
	var map = null;
	window.onload = function() {
		getLocation();
		var opt = {
			center : new google.maps.LatLng(37.56621, 126.9779),
			zoom : 15,
			mapTypeId : google.maps.MapTypeId.ROADMAP
		};
		map = new google.maps.Map(document.getElementById("map"), opt);

	}

	function showLocation(position) {
		var latitude = position.coords.latitude;
		var longitude = position.coords.longitude;
		alert("Latitude : " + latitude + " Longitude: " + longitude);
		
		var hear = new google.maps.LatLng(latitude, longitude);
		map.panTo(hear);
		var marker = new google.maps.Marker({
		    position: hear,
		    title:"I'm hear!"
		});
		marker.setMap(map);
	}

	function errorHandler(err) {
		if (err.code == 1) {
			alert("Error: Access is denied!");
		} else if (err.code == 2) {
			alert("Error: Position is unavailable!");
		}else if(err.code == 3){
			alert("Error : Time out");
		}
	}
	function getLocation() {
		if (navigator.geolocation) {
			var options = {
				timeout : 60000,
				enabledHighAccuracy :true
			};
			navigator.geolocation.getCurrentPosition(showLocation,
					errorHandler, options);
		} else {
			alert("Sorry, browser does not support geolocation!");
		}
	}
</script>
</head>
<body>
    <div data-role="page">
        <div data-role="header" data-theme="b" data-position="fixed">
            <a href="/" data-icon="home" class="ui-btn-left">Home</a>
            <h1>Map View</h1>
            <a href="#" data-icon="refresh">Refresh</a>
        </div>
    </div>
	<div id="map" style="width: 100%; height: 100%;"></div>
</body>
</html>
